home *** CD-ROM | disk | FTP | other *** search
/ Clinical Endocrinology / Clinical Endocrinology.iso / pc / 00000000 / 21000000 / 21100000 / shared.dir / 00954_Script_954 < prev    next >
Text File  |  1995-11-17  |  2KB  |  81 lines

  1. -- Handler to set up global to contain a string which
  2. -- is the first bit of the moviePath
  3.  
  4. on setDisk
  5.   global hardDisk, menuSwitch
  6.   
  7.   put the pathname into checkThisPath
  8.   
  9.   put offset("00000000", checkThisPath) into endOfString
  10.   
  11.   put char 1 to endOfString + 8 of checkThisPath into hardDisk
  12.   set menuSwitch = "off"
  13.   
  14. end setDisk
  15. ---------------------------------------------------------
  16. -- Handler to determine which platform the CD is running on
  17. -- and specifying which separator, i.e. ":" or "/" to use.
  18. -- The correct separator is stored as a global, "gSep" - short
  19. -- for global separator.
  20.  
  21. on whereAmI
  22.   global gSep
  23.   
  24.   if the machineType <> 256 then
  25.     set gSep = ":"
  26.   else
  27.     set gSep = "\"
  28.   end if
  29.   
  30. end whereAmI
  31. ---------------------------------------------------------------
  32. -- Handler triggered from handler "menuDrop" when a menu item
  33. -- is clicked on. The variable "itemNumber refers to the place
  34. -- in the menu the item resides. The number corresponds to a
  35. -- pre-defined list in text cast member "Menu Links"
  36. -- which is a line by line list of links to other movies.
  37. -- N.B. The 1st line is always "The Endocrine System" not the
  38. -- screen title.
  39.  
  40. on menuItem itemNumber
  41.   global HardDisk, gSep, pathToMovie
  42.   
  43.   put line itemNumber of field "Menu Links" into menuLinkString
  44.   
  45.   stripMoviePath menuLinkString
  46.   keepHistory
  47.   go movie hardDisk & pathToMovie
  48.   
  49. end menuItem
  50. ---------------------------------------------------------------
  51. -- Handler to strip a line of text with words separated by spaces
  52. -- and make a new line of text which is a pathname with platform
  53. -- specific separators.
  54.  
  55. on stripMoviePath textToStrip
  56.   
  57.   global gSep, pathToMovie
  58.   
  59.   if voidP(gSep) = true then put ":" into gSep
  60.   
  61.   put the number of words in textToStrip into theWordCount
  62.   set pathToMovie = ""
  63.   repeat with i = 1 to theWordCount
  64.     
  65.     put word i of textToStrip after pathToMovie
  66.     if i = theWordCount then exit repeat
  67.     put gSep after pathToMovie
  68.   end repeat
  69.   put pathToMovie
  70.   
  71.   
  72. end stripMoviePath
  73. ------------------------------------------------
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.